@extends('layouts.app')

@section('title',$user->name.'的个人编辑页')


@section('content')
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h3 class="text-center pt-3">编辑用户信息</h3>
                </div>
                <div class="card-body">
                    @include('shared._errors')
                    <form action="{{route('users.update',$user)}}" method="post" enctype="multipart/form-data">
                        @csrf
                        @method('put')
                        <div class="form-group">
                            <label for="name" class="col-form-label">用户名</label>
                            <input type="text" name="name" class="form-control" id="name" value="{{old('name',$user->name)}}">
                        </div>

                        <div class="form-group">
                            <label for="email" class="col-form-label">邮箱</label>
                            <input type="email" class="form-control" id="email" value="{{$user->email}}" disabled>
                        </div>

                        <div class="form-group">
                            <label for="introduction" class="col-form-label">个人简介</label>
                            <textarea type="text" name="introduction" class="form-control" id="introduction">
                                {{old('introduction',$user->introduction)}}
                            </textarea>
                        </div>

                        <div class="form-group">
                            <label for="avatar" class="form-label">用户头像</label>
                            <input type="file" name="avatar" class="form-control-file" id="avatar">
                        </div>

                        <hr>
                        <div class="d-flex justify-content-center">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@stop
